package com.xzy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.view.RedirectView;

/**
 * 重定向
 *
 * @author xzy.xiao
 * @date 2022/8/31  17:05
 */
@Controller
@RequestMapping(path = "redirect")
public class RedirectController {

    @GetMapping("/payment")
    public String payment() {
        return "direct/payment";
    }

    @GetMapping("/baidu")
    public ModelAndView baidu() {
        return new ModelAndView(new RedirectView("https://www.baidu.com"));
    }
}
